import { IRouteComponentProps ,Redirect} from 'umi'

export default function Layout(props: IRouteComponentProps) {

    //在这里做重定向
   console.log(props.location)
   if(props.location.pathname==="/"){
          return   <Redirect from={props.location.pathname} to="/admin" exact></Redirect>
   }else{
        return props.children 
   }
 
}